package com.ikingtech.platform.service.application.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ikingtech.platform.service.application.entity.ApplicationPageModelDO;
import com.ikingtech.platform.service.application.mapper.ApplicationPageModelMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tie yan
 */
@Service
@RequiredArgsConstructor
public class ApplicationPageModelService extends ServiceImpl<ApplicationPageModelMapper, ApplicationPageModelDO> {

    public void removeByPageId(String pageId) {
        this.remove(Wrappers.<ApplicationPageModelDO>lambdaQuery().eq(ApplicationPageModelDO::getPageId, pageId));
    }

    public List<ApplicationPageModelDO> listByPageIds(List<String> pageIds) {
        return this.list(Wrappers.<ApplicationPageModelDO>lambdaQuery().in(ApplicationPageModelDO::getPageId, pageIds));
    }

    public List<ApplicationPageModelDO> listByPageId(String pageId) {
        return this.list(Wrappers.<ApplicationPageModelDO>lambdaQuery().eq(ApplicationPageModelDO::getPageId, pageId));
    }
}
